﻿using System;
using EAF.Utility;

namespace App.Utility
{
    /// <summary>
    /// app公共数据
    /// </summary>
    public static class AppData
    { 
        private static string projectName = null;
        /// <summary>
        /// 项目名简称 现已用做缓存、队列前缀 命名正式项目名简称 
        /// </summary> 
        public static string ProjectName
        {
            get
            {
                return projectName;
            }
            set
            {
                if (!projectName.IsNull())
                {
                    throw new Exception("此字段值只能set一次");
                }
                projectName = value;
            }
        }

        private static int platformId = 0;
        /// <summary>
        /// 平台id
        /// </summary>
        public static int PlatformId
        {
            get
            {
                return platformId;
            }
            set
            {
                if (platformId != 0)
                {
                    throw new Exception("此字段值只能set一次");
                }
                platformId = value;
            }
        }

        private static string platformApiPath = null;
        /// <summary>
        /// 平台接口前缀（平台名）
        /// </summary>
        public static string PlatformApiPrefix
        {
            get
            {
                return platformApiPath;
            }
            set
            {
                if (!platformApiPath.IsNull())
                {
                    throw new Exception("此字段值只能set一次");
                }
                platformApiPath = value;
            }
        }

    }

}
